package org.edu.modules.oa.controller;

import groovy.util.logging.Slf4j;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.edu.common.api.vo.Result;
import org.edu.common.aspect.annotation.AutoLog;
import org.edu.modules.oa.entity.VeOaMeetEntity;
import org.edu.modules.oa.entity.VeOaMeetPlaceEntity;
import org.edu.modules.oa.mapper.ISysDictItemMapper;
import org.edu.modules.oa.service.IVeOaMeetApplyServer;
import org.edu.modules.oa.service.IVeOaMeetCheckService;
import org.edu.modules.oa.service.IVeOaMeetPlaceService;
import org.edu.modules.oa.vo.VeOaMeetApplyTable;
import org.edu.modules.oa.vo.VeOaMeetCheckTableVo;
import org.edu.modules.oa.vo.VeOaMeetProceedApplyVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Api(tags="会议申请")
@RestController
@RequestMapping("oa/veOaMeetApply")
@Slf4j
public class VeOaMeetApplyController {
    // 会议申请业务
    @Resource
    private IVeOaMeetApplyServer iVeOaMeetApplyServer;





    // 日志注解
    @AutoLog(value = "会议申请-显示表格")
    @ApiOperation(value="显示表格", notes="会议申请-显示表格")
    // 显示表格
    @PostMapping(value = "/showTable")

    public Result<?> showTable( VeOaMeetApplyTable veOaMeetApplyTable, Integer startPage, Integer pageSize) {


        HashMap<String, Object> map=iVeOaMeetApplyServer.showTable(veOaMeetApplyTable,startPage,pageSize);

        return Result.OK(map);
    }

    // @RequestBody get()
    // 日志注解
    @AutoLog(value = "会议申请-会议发起申请")
    @ApiOperation(value="会议发起申请", notes="会议申请-会议发起申请")
    // 会议发起申请
    @PostMapping(value = "/meetProceedApply")

    public Result<?> meetProceedApply( VeOaMeetProceedApplyVo veOaMeetApplyTable) throws Throwable {
        System.out.println(veOaMeetApplyTable);

        Integer result=  iVeOaMeetApplyServer.meetProceedApply(veOaMeetApplyTable);

//
//        HashMap<String, Object> map=iVeOaMeetApplyServer.showTable(veOaMeetApplyTable,startPage,pageSize);
//
//        return Result.OK(map);
        return  null;
    }

    // 加载教职工下拉框 和 编制类别下拉框
    // 日志注解
    @AutoLog(value = "会议申请-加载下拉框")
    @ApiOperation(value="会议发起申请", notes="会议申请-加载下拉框")
    // 会议发起申请
    @PostMapping(value = "/loadBox")

    public Result<?> loadBox()  {

        HashMap<String ,Object> map=  iVeOaMeetApplyServer.loadBox();

        return  Result.OK(map);
    }

}
